{% extends 'base.html' %}
{% load static %}

{% block title %}注册 - 电影院票务管理系统{% endblock %}

{% block content %}
<div class="row justify-content-center">
    <div class="col-md-8 col-lg-6">
        <div class="card shadow">
            <div class="card-header bg-success text-white text-center">
                <h4 class="mb-0"><i class="fas fa-user-plus me-2"></i>用户注册</h4>
            </div>
            <div class="card-body p-4">
                <form method="post">
                    {% csrf_token %}
                    
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label for="{{ form.username.id_for_label }}" class="form-label">
                                <i class="fas fa-user me-1"></i>用户名
                            </label>
                            {{ form.username }}
                            {% if form.username.errors %}
                                <div class="text-danger small">{{ form.username.errors.0 }}</div>
                            {% endif %}
                        </div>
                        <div class="col-md-6 mb-3">
                            <label for="{{ form.email.id_for_label }}" class="form-label">
                                <i class="fas fa-envelope me-1"></i>邮箱
                            </label>
                            {{ form.email }}
                            {% if form.email.errors %}
                                <div class="text-danger small">{{ form.email.errors.0 }}</div>
                            {% endif %}
                        </div>
                    </div>
                    
                    <div class="mb-3">
                        <label for="{{ form.phone.id_for_label }}" class="form-label">
                            <i class="fas fa-phone me-1"></i>手机号（可选）
                        </label>
                        {{ form.phone }}
                        {% if form.phone.errors %}
                            <div class="text-danger small">{{ form.phone.errors.0 }}</div>
                        {% endif %}
                    </div>
                    
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label for="{{ form.password1.id_for_label }}" class="form-label">
                                <i class="fas fa-lock me-1"></i>密码
                            </label>
                            {{ form.password1 }}
                            {% if form.password1.errors %}
                                <div class="text-danger small">{{ form.password1.errors.0 }}</div>
                            {% endif %}
                        </div>
                        <div class="col-md-6 mb-3">
                            <label for="{{ form.password2.id_for_label }}" class="form-label">
                                <i class="fas fa-lock me-1"></i>确认密码
                            </label>
                            {{ form.password2 }}
                            {% if form.password2.errors %}
                                <div class="text-danger small">{{ form.password2.errors.0 }}</div>
                            {% endif %}
                        </div>
                    </div>
                    
                    <div class="d-grid">
                        <button type="submit" class="btn btn-success">
                            <i class="fas fa-user-plus me-1"></i>注册
                        </button>
                    </div>
                </form>
                
                <hr class="my-4">
                
                <div class="text-center">
                    <p class="mb-2">已有账号？</p>
                    <a href="{% url 'login' %}" class="btn btn-outline-primary">
                        <i class="fas fa-sign-in-alt me-1"></i>立即登录
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 